<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function isPalindrome(str) {
            if (!str || str.length < 2) {
                return;
            }
            for (let i = 0; i < str.length / 2; i++) {
                if (str[i] !== str[str.length - 1 - i]) {
                    return false;
                }
            }
            return true;
        }
        console.log(isPalindrome("madama"))

    </script>
</body>

</html>